package com.za.apm.cat.action;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.za.apm.cat.util.HttpUtils;

import okhttp3.Response;

/**
 * 类RemoteAction.java的实现描述：
 * 
 * @author: tongyufu 2017-11-22 14:49:16
 */
@RestController
@RequestMapping("/remote")
public class RemoteAction {

	Logger log = LoggerFactory.getLogger(FirstAction.class);

	@RequestMapping("first")
	public String first() throws Exception {
		String url = "http://localhost:8081/remote/second";
		// Cat.logRemoteCallClient(new CatContext());
		log.info("===first");
		Response response = HttpUtils.doGet(url);
		log.info("------" + response.body().string());
		return "all success";
	}

	@RequestMapping("second")
	public String second() {
		log.info("===second");
		return "second success";
	}
}
